using System; using System.Collections.Generic; using System.Linq; using System.Text; using UnityEngine; namespace TaxFraud { public class Module : ETGModule { public override void Start() { try { ETGModConsole.Commands.AddGroup("setcredits", delegate (string[] args) { if (args == null) ETGModConsole.Log("No args"); if (args.Length > 1) ETGModConsole.Log("Too many args"); string id = args[0]; bool wasset = false; int id2 = -1; try { id2 = int.Parse(id); wasset = true; } catch { ETGModConsole.Log("That's not an integer value"); } if (wasset) { if (id2 == 0) { GameStatsManager.Instance.ClearStatValueGlobal(TrackedStats.META_CURRENCY); ETGModConsole.Log("Cleared All Credits."); } else { int change = id2 - (int)GameStatsManager.Instance.GetPlayerStatValue(TrackedStats.META_CURRENCY); GameStatsManager.Instance.RegisterStatChange(TrackedStats.META_CURRENCY, change); ETGModConsole.Log($"Set Credits to {id2} ({change})"); } } }); ETGModConsole.Log("Tax Fraud has been initialised, the IRS is coming for you."); } catch (Exception e) { ETGModConsole.Log(e.Message); ETGModConsole.Log(e.StackTrace); } } public override void Exit() { } public override void Init() { } } }